<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>SOCKS5Tunnel</title><link rel="stylesheet" type="text/css" href="../../../styles/main.css"><script language=JavaScript src="../../../javascript/main.js"></script><script language=JavaScript src="../../../javascript/prettify.js"></script><script language=JavaScript src="../../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="SOCKS5Tunnel"></a>SOCKS5Tunnel</h1><div class=CBody><div class=ClassHierarchy><table border=0 cellspacing=0 cellpadding=0><tr><td><div class=CHParent><div class=CHEntry>EventDispatcher</div></div></td></tr></table><div class=CHIndent><table border=0 cellspacing=0 cellpadding=0><tr><td><div class=CHCurrent><div class=CHEntry>SOCKS5Tunnel</div></div></td></tr></table></div></div><p>Provides SOCKS5-capable transport services for proxied network requests.&nbsp; This protocol is also used by Tor to transport various network requests.&nbsp; Since TorControl is used to manage the Tor services process, if this process is already correctly configured and running SOCKS5Tunnel can be used completely independently (TorControl may be entirely omitted).</p><h4 class=CHeading>Author</h4><p>Patrick Bay  The MIT License (MIT)  Copyright &copy; 2013 Patrick Bay  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &ldquo;Software&rdquo;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.&nbsp;  THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.&nbsp; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&nbsp;  ---  This library incorporate the &ldquo;as3crypto&rdquo; library by Henri Torgeman.&nbsp; Additional licences for this libary and additionally incorporated source code are displayed below:  Copyright &copy; 2007 Henri Torgemane All Rights Reserved.&nbsp;  BigInteger, RSA, Random and ARC4 are derivative works of the jsbn library (http://www-cs-students.stanford.edu/~tjw/jsbn/) The jsbn library is Copyright &copy; 2003-2005  Tom Wu (tjw@cs.Stanford.EDU)  MD5, SHA1, and SHA256 are derivative works (http://pajhome.org.uk/crypt/md5/) Those are Copyright &copy; 1998-2002 Paul Johnston &amp; Contributors (paj@pajhome.org.uk)  SHA256 is a derivative work of jsSHA2 (http://anmar.eu.org/projects/jssha2/) jsSHA2 is Copyright &copy; 2003-2004 Angel Marin (anmar@gmx.net)  AESKey is a derivative work of aestable.c (http://www.geocities.com/malbrain/aestable_c.html) aestable.c is Copyright &copy; Karl Malbrain (malbrain@yahoo.com)  BlowFishKey, DESKey and TripeDESKey are derivative works of the Bouncy Castle Crypto Package (http://www.bouncycastle.org) Those are Copyright &copy; 2000-2004 The Legion Of The Bouncy Castle  Base64 is copyright &copy; 2006 Steve Webster (http://dynamicflash.com/goodies/base64)  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.&nbsp; Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.&nbsp;  Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.&nbsp;  THE SOFTWARE IS PROVIDED &ldquo;AS-IS&rdquo; AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.&nbsp;  IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.&nbsp;  ---  Additionally, the MD5 algorithm is covered by the following notice: Copyright &copy; 1991-2, RSA Data Security, Inc.&nbsp; Created 1991.&nbsp; All rights reserved.&nbsp;  License to copy and use this software is granted provided that it is identified as the &ldquo;RSA Data Security, Inc.&nbsp; MD5 Message-Digest Algorithm&rdquo; in all material mentioning or referencing this software or this function.&nbsp;  License is also granted to make and use derivative works provided that such works are identified as &ldquo;derived from the RSA Data Security, Inc.&nbsp; MD5 Message-Digest Algorithm&rdquo; in all material mentioning or referencing the derived work.&nbsp;  RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose.&nbsp; It is provided &ldquo;as is&rdquo; without express or implied warranty of any kind.&nbsp;  These notices must be retained in any copies of any part of this documentation and/or software.&nbsp; </p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#SOCKS5Tunnel" >SOCKS5Tunnel</a></td><td class=SDescription>Provides SOCKS5-capable transport services for proxied network requests. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SOCKS5Tunnel.Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.defaultSOCKSIP" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">defaultSOCKSIP</a></td><td class=SDescription>Default SOCKS5 IP address. </td></tr><tr class="SConstant SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.defaultSOCKSPort" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">defaultSOCKSPort</a></td><td class=SDescription>Default SOCKS5 port.</td></tr><tr class="SConstant SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.maxRedirects" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">maxRedirects</a></td><td class=SDescription>Maximum number of redirects to follow, if enabled, whenever a 301 or 302 HTTP status is received.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SOCKS5Tunnel.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel._tunnelSocket" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">_tunnelSocket</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel._secureTunnelSocket" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">_secureTunnelSocket</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel._tunnelIP" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">_tunnelIP</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel._tunnelPort" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">_tunnelPort</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel._connectionType" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">_connectionType</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel._connected" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">_connected</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel._authenticated" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">_authenticated</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel._tunneled" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">_tunneled</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel._requestActive" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">_requestActive</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel._requestBuffer" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">_requestBuffer</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel._responseBuffer" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">_responseBuffer</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel._HTTPStatusReceived" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">_HTTPStatusReceived</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel._HTTPHeadersReceived" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">_HTTPHeadersReceived</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel._HTTPResponse" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">_HTTPResponse</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel._currentRequest" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">_currentRequest</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel._redirectCount" id=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">_redirectCount</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SOCKS5Tunnel.Functions_and_Properties" >Functions and Properties</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.SOCKS5Tunnel" id=link20 onMouseOver="ShowTip(event, 'tt20', 'link20')" onMouseOut="HideTip('tt20')">SOCKS5Tunnel</a></td><td class=SDescription>Creates an instance of a SOCKS5 proxy tunnel.</td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.tunnelIP" id=link21 onMouseOver="ShowTip(event, 'tt21', 'link21')" onMouseOut="HideTip('tt21')">tunnelIP</a></td><td class=SDescription>The current SOCKS proxy tunnel IP being used by the instance.</td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.tunnelPort" id=link22 onMouseOver="ShowTip(event, 'tt22', 'link22')" onMouseOut="HideTip('tt22')">tunnelPort</a></td><td class=SDescription>The current SOCKS proxy tunnel port being used by the instance.</td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.connectionType" id=link23 onMouseOver="ShowTip(event, 'tt23', 'link23')" onMouseOut="HideTip('tt23')">connectionType</a></td><td class=SDescription>The tunnel connection type being managed by this instance.</td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.connected" id=link24 onMouseOver="ShowTip(event, 'tt24', 'link24')" onMouseOut="HideTip('tt24')">connected</a></td><td class=SDescription>The status of the tunnel connection (true=connected, false=not connected). </td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.tunneled" id=link25 onMouseOver="ShowTip(event, 'tt25', 'link25')" onMouseOut="HideTip('tt25')">tunneled</a></td><td class=SDescription>The status of the proxy tunnel (true=ready, false=not ready). </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.loadHTTP" id=link26 onMouseOver="ShowTip(event, 'tt26', 'link26')" onMouseOut="HideTip('tt26')">loadHTTP</a></td><td class=SDescription>Sends a HTTP request through the socks proxy, sending any included information (such as form data) in the process. </td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.activeRequest" id=link27 onMouseOver="ShowTip(event, 'tt27', 'link27')" onMouseOut="HideTip('tt27')">activeRequest</a></td><td class=SDescription>The currently active HTTP/HTTPS request being handled by the tunnel instance.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.establishNewCircuit" id=link28 onMouseOver="ShowTip(event, 'tt28', 'link28')" onMouseOut="HideTip('tt28')">establishNewCircuit</a></td><td class=SDescription>Attempts to establish a new Tor circuit through a running TorControl instance. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.disconnectSocket" id=link29 onMouseOver="ShowTip(event, 'tt29', 'link29')" onMouseOut="HideTip('tt29')">disconnectSocket</a></td><td class=SDescription>Disconnects the SOCKS5 tunnel socket if connected.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.removeSocketListeners" id=link30 onMouseOver="ShowTip(event, 'tt30', 'link30')" onMouseOut="HideTip('tt30')">removeSocketListeners</a></td><td class=SDescription>Removes standard listeners to the default SOCKS5 tunnel socket.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.addSocketListeners" id=link31 onMouseOver="ShowTip(event, 'tt31', 'link31')" onMouseOut="HideTip('tt31')">addSocketListeners</a></td><td class=SDescription>Adds standard listeners to the default SOCKS5 tunnel socket.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.onTunnelConnect" id=link32 onMouseOver="ShowTip(event, 'tt32', 'link32')" onMouseOut="HideTip('tt32')">onTunnelConnect</a></td><td class=SDescription>Invoked when the SOCKS5 tunnel socket connection is successfully established.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.onTunnelConnectError" id=link33 onMouseOver="ShowTip(event, 'tt33', 'link33')" onMouseOut="HideTip('tt33')">onTunnelConnectError</a></td><td class=SDescription>Invoked when the SOCKS5 tunnel receives an IOErrorEvent event.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.onTunnelDisconnect" id=link34 onMouseOver="ShowTip(event, 'tt34', 'link34')" onMouseOut="HideTip('tt34')">onTunnelDisconnect</a></td><td class=SDescription>Invoked when the SOCKS5 tunnel socket has been disconnected.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.authenticateTunnel" id=link35 onMouseOver="ShowTip(event, 'tt35', 'link35')" onMouseOut="HideTip('tt35')">authenticateTunnel</a></td><td class=SDescription>Invoked to authenticate the SOCKS5 tunnel after it is connected. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.onAuthenticateTunnel" id=link36 onMouseOver="ShowTip(event, 'tt36', 'link36')" onMouseOut="HideTip('tt36')">onAuthenticateTunnel</a></td><td class=SDescription>Invoked when the SOCKS5 tunnel authentication has completed and the end-to-end connection is ready to be established.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.establishHTTPTunnel" id=link37 onMouseOver="ShowTip(event, 'tt37', 'link37')" onMouseOut="HideTip('tt37')">establishHTTPTunnel</a></td><td class=SDescription>Establishes a HTTP/HTTPS tunnel once the SOCKS5 socket has been connected and authenticated. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.onEstablishTunnel" id=link38 onMouseOver="ShowTip(event, 'tt38', 'link38')" onMouseOut="HideTip('tt38')">onEstablishTunnel</a></td><td class=SDescription>Invoked when the SOCKS5 tunnel has been established (connected and authenticated).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.sendQueuedHTTPRequest" id=link39 onMouseOver="ShowTip(event, 'tt39', 'link39')" onMouseOut="HideTip('tt39')">sendQueuedHTTPRequest</a></td><td class=SDescription>Sends the next queued HTTP/HTTPS request. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.startTLSTunnel" id=link40 onMouseOver="ShowTip(event, 'tt40', 'link40')" onMouseOut="HideTip('tt40')">startTLSTunnel</a></td><td class=SDescription>Starts TLS for HTTPS requests/responses.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.authResponseOkay" id=link41 onMouseOver="ShowTip(event, 'tt41', 'link41')" onMouseOut="HideTip('tt41')">authResponseOkay</a></td><td class=SDescription>Tests whether or not the SOCKS5 authentication request was successful.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.tunnelResponseOkay" id=link42 onMouseOver="ShowTip(event, 'tt42', 'link42')" onMouseOut="HideTip('tt42')">tunnelResponseOkay</a></td><td class=SDescription>Tests whether or not the SOCKS5 response indicates that the tunnel has been established and is ready for communication.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.tunnelRequestComplete" id=link43 onMouseOver="ShowTip(event, 'tt43', 'link43')" onMouseOut="HideTip('tt43')">tunnelRequestComplete</a></td><td class=SDescription>Tests whether or not the SOCKS5 response data indicates that the entire HTTP/HTTPS request and response are complete.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.handleHTTPRedirect" id=link44 onMouseOver="ShowTip(event, 'tt44', 'link44')" onMouseOut="HideTip('tt44')">handleHTTPRedirect</a></td><td class=SDescription>Handles a HTTP redirect (301 or 302 response code).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SOCKS5Tunnel.handleHTTPResponse" id=link45 onMouseOver="ShowTip(event, 'tt45', 'link45')" onMouseOut="HideTip('tt45')">handleHTTPResponse</a></td><td class=SDescription>Handles a raw, partial or complete HTTP response. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SOCKS5Tunnel.onTunnelData" id=link46 onMouseOver="ShowTip(event, 'tt46', 'link46')" onMouseOut="HideTip('tt46')">onTunnelData</a></td><td class=SDescription>Handles raw HTTP/HTTPS data from the SOCKS5 tunnel socket. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.Constants"></a>Constants</h3></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.defaultSOCKSIP"></a>defaultSOCKSIP</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public static const defaultSOCKSIP: String</td></tr></table></blockquote><p>Default SOCKS5 IP address.&nbsp; For Tor networking, this is usually 127.0.0.1 (the current local machine).</p></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.defaultSOCKSPort"></a>defaultSOCKSPort</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public static const defaultSOCKSPort: int</td></tr></table></blockquote><p>Default SOCKS5 port.</p></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.maxRedirects"></a>maxRedirects</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public static const maxRedirects: int</td></tr></table></blockquote><p>Maximum number of redirects to follow, if enabled, whenever a 301 or 302 HTTP status is received.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._tunnelSocket"></a>_tunnelSocket</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _tunnelSocket: Socket</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._secureTunnelSocket"></a>_secureTunnelSocket</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _secureTunnelSocket: TLSSocket</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._tunnelIP"></a>_tunnelIP</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _tunnelIP: String</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._tunnelPort"></a>_tunnelPort</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _tunnelPort: int</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._connectionType"></a>_connectionType</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _connectionType: int</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._connected"></a>_connected</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _connected: Boolean</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._authenticated"></a>_authenticated</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _authenticated: Boolean</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._tunneled"></a>_tunneled</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _tunneled: Boolean</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._requestActive"></a>_requestActive</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _requestActive: Boolean</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._requestBuffer"></a>_requestBuffer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _requestBuffer: Array</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._responseBuffer"></a>_responseBuffer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _responseBuffer: ByteArray</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._HTTPStatusReceived"></a>_HTTPStatusReceived</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _HTTPStatusReceived: Boolean</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._HTTPHeadersReceived"></a>_HTTPHeadersReceived</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _HTTPHeadersReceived: Boolean</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._HTTPResponse"></a>_HTTPResponse</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _HTTPResponse: HTTPResponse</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._currentRequest"></a>_currentRequest</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _currentRequest: URLRequest</td></tr></table></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel._redirectCount"></a>_redirectCount</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _redirectCount: int</td></tr></table></blockquote></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.Functions_and_Properties"></a>Functions and Properties</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.SOCKS5Tunnel"></a>SOCKS5Tunnel</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function SOCKS5Tunnel(</td><td class="PParameter  prettyprint " nowrap>tunnelIP:</td><td class="PType  prettyprint " nowrap>&nbsp;String</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%>null,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>tunnelPort:</td><td class="PType  prettyprint " nowrap>&nbsp;int</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%>-1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates an instance of a SOCKS5 proxy tunnel.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  tunnelIP The SOCKS proxy IP to use.&nbsp; If not specified, the current default value is used.</td></tr><tr><td class=CDLEntry>param</td><td class=CDLDescription>  tunnelPort The SOCKS proxy port to use.&nbsp; If not specified, the current default value is used.&nbsp; </td></tr></table></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.tunnelIP"></a>tunnelIP</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get tunnelIP():String</td></tr></table></blockquote><p>The current SOCKS proxy tunnel IP being used by the instance.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.tunnelPort"></a>tunnelPort</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get tunnelPort():int</td></tr></table></blockquote><p>The current SOCKS proxy tunnel port being used by the instance.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.connectionType"></a>connectionType</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get connectionType():int</td></tr></table></blockquote><p>The tunnel connection type being managed by this instance.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.connected"></a>connected</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get connected():Boolean</td></tr></table></blockquote><p>The status of the tunnel connection (true=connected, false=not connected).&nbsp; Requests cannot be sent through the proxy unless it is both connected and tunneled.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.tunneled"></a>tunneled</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get tunneled():Boolean</td></tr></table></blockquote><p>The status of the proxy tunnel (true=ready, false=not ready).&nbsp; Requests cannot be sent through the proxy unless it is both connected and tunneled.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.loadHTTP"></a>loadHTTP</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function loadHTTP(</td><td class="PParameter  prettyprint " nowrap>request:</td><td class="PType  prettyprint " nowrap>&nbsp;URLRequest</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote><p>Sends a HTTP request through the socks proxy, sending any included information (such as form data) in the process.&nbsp; Additional requests via this tunnel connection will be disallowed until this one has completed (since replies may be multi-part).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>request</td><td class=CDLDescription>The URLRequest object holding the necessary information for the request.&nbsp; </td></tr></table><h4 class=CHeading>Returns</h4><p>True if the request was dispatched successfully, false otherwise.&nbsp; </p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.activeRequest"></a>activeRequest</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get activeRequest():*</td></tr></table></blockquote><p>The currently active HTTP/HTTPS request being handled by the tunnel instance.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.establishNewCircuit"></a>establishNewCircuit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function establishNewCircuit():Boolean</td></tr></table></blockquote><p>Attempts to establish a new Tor circuit through a running TorControl instance.&nbsp; Future SOCKS5Tunnel instances will communicate through the new circuit while existing and connected instances will continue to communicate through their existing circuits until closed.&nbsp; A TorControl instance must be instantiated and fully initialized before attempting to invoke this command.</p><h4 class=CHeading>Returns</h4><p>True if TorControl is active and could be invoked to establish a new circuit, false if the invocation failed for any reason.&nbsp; </p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.disconnectSocket"></a>disconnectSocket</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function disconnectSocket():void</td></tr></table></blockquote><p>Disconnects the SOCKS5 tunnel socket if connected.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.removeSocketListeners"></a>removeSocketListeners</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function removeSocketListeners():void</td></tr></table></blockquote><p>Removes standard listeners to the default SOCKS5 tunnel socket.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.addSocketListeners"></a>addSocketListeners</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function addSocketListeners():void</td></tr></table></blockquote><p>Adds standard listeners to the default SOCKS5 tunnel socket.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.onTunnelConnect"></a>onTunnelConnect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function onTunnelConnect(</td><td class="PParameter  prettyprint " nowrap>eventObj:</td><td class="PType  prettyprint " nowrap>&nbsp;Event</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote><p>Invoked when the SOCKS5 tunnel socket connection is successfully established.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  eventObj A standard Event object.&nbsp; </td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.onTunnelConnectError"></a>onTunnelConnectError</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function onTunnelConnectError(</td><td class="PParameter  prettyprint " nowrap>eventObj:</td><td class="PType  prettyprint " nowrap>&nbsp;IOErrorEvent</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote><p>Invoked when the SOCKS5 tunnel receives an IOErrorEvent event.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  eventObj A standard IOErrorEvent object.&nbsp; </td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.onTunnelDisconnect"></a>onTunnelDisconnect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function onTunnelDisconnect(</td><td class="PParameter  prettyprint " nowrap>eventObj:</td><td class="PType  prettyprint " nowrap>&nbsp;Event</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote><p>Invoked when the SOCKS5 tunnel socket has been disconnected.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  eventObj A standard Event object.&nbsp; </td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.authenticateTunnel"></a>authenticateTunnel</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function authenticateTunnel():void</td></tr></table></blockquote><p>Invoked to authenticate the SOCKS5 tunnel after it is connected.&nbsp; The tunnel will not accept any outbound requests until authentication has been completed.</p><p>Note: Currently only the 0 (none) authentication type is supported.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.onAuthenticateTunnel"></a>onAuthenticateTunnel</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function onAuthenticateTunnel():void</td></tr></table></blockquote><p>Invoked when the SOCKS5 tunnel authentication has completed and the end-to-end connection is ready to be established.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.establishHTTPTunnel"></a>establishHTTPTunnel</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function establishHTTPTunnel():void</td></tr></table></blockquote><p>Establishes a HTTP/HTTPS tunnel once the SOCKS5 socket has been connected and authenticated.&nbsp; If no port is specified, HTTP connections will be attempted over port 80 while HTTPS connections will be attempted over port 443.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.onEstablishTunnel"></a>onEstablishTunnel</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function onEstablishTunnel():void</td></tr></table></blockquote><p>Invoked when the SOCKS5 tunnel has been established (connected and authenticated).</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.sendQueuedHTTPRequest"></a>sendQueuedHTTPRequest</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function sendQueuedHTTPRequest():void</td></tr></table></blockquote><p>Sends the next queued HTTP/HTTPS request.&nbsp; Requests are queued whenever a connection has not yet been established or authentication is not yet complete.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.startTLSTunnel"></a>startTLSTunnel</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function startTLSTunnel():void</td></tr></table></blockquote><p>Starts TLS for HTTPS requests/responses.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.authResponseOkay"></a>authResponseOkay</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function authResponseOkay(</td><td class="PParameter  prettyprint " nowrap>respData:</td><td class="PType  prettyprint " nowrap>&nbsp;ByteArray</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote><p>Tests whether or not the SOCKS5 authentication request was successful.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  respData The raw response data to analyze.&nbsp; </td></tr></table><h4 class=CHeading>Returns</h4><p>True if the response confirms that authentication was successful, false otherwise.&nbsp; </p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.tunnelResponseOkay"></a>tunnelResponseOkay</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function tunnelResponseOkay(</td><td class="PParameter  prettyprint " nowrap>respData:</td><td class="PType  prettyprint " nowrap>&nbsp;ByteArray</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote><p>Tests whether or not the SOCKS5 response indicates that the tunnel has been established and is ready for communication.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  respData The raw SOCKS5 response message to analyze.&nbsp; </td></tr></table><h4 class=CHeading>Returns</h4><p>True if the SOCKS5 tunnel is ready to proxy requests and responses, false otherwise.&nbsp; </p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.tunnelRequestComplete"></a>tunnelRequestComplete</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function tunnelRequestComplete(</td><td class="PParameter  prettyprint " nowrap>respData:</td><td class="PType  prettyprint " nowrap>&nbsp;ByteArray</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote><p>Tests whether or not the SOCKS5 response data indicates that the entire HTTP/HTTPS request and response are complete.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  respData The raw SOCKS5 data to analyze.&nbsp; </td></tr></table><h4 class=CHeading>Returns</h4><p>True if the tunneled transaction appears to be complete, false otherwise.&nbsp; </p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.handleHTTPRedirect"></a>handleHTTPRedirect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function handleHTTPRedirect(</td><td class="PParameter  prettyprint " nowrap>responseObj:</td><td class="PType  prettyprint " nowrap>&nbsp;HTTPResponse</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote><p>Handles a HTTP redirect (301 or 302 response code).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  responseObj The HTTPResponse object to analyze for redirection information.&nbsp; </td></tr></table><h4 class=CHeading>Returns</h4><p>True if the supplied response is a redirect and the redirect was automatically handled, false otherwise.&nbsp; </p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.handleHTTPResponse"></a>handleHTTPResponse</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function handleHTTPResponse(</td><td class="PParameter  prettyprint " nowrap>rawData:</td><td class="PType  prettyprint " nowrap>&nbsp;ByteArray,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>secure:</td><td class="PType  prettyprint " nowrap>&nbsp;Boolean</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%>false</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote><p>Handles a raw, partial or complete HTTP response.&nbsp; This method also handles HTTPS responses after decryption using the same mechanisms.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  rawData The raw HTTP data to analyze and process.</td></tr><tr><td class=CDLEntry>param</td><td class=CDLDescription>  secure Used with the SOCKS5TunnelEvent dispatched by this method to inform listeners whether or not the response is secure (HTTPS).&nbsp; </td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SOCKS5Tunnel.onTunnelData"></a>onTunnelData</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function onTunnelData(</td><td class="PParameter  prettyprint " nowrap>eventObj:</td><td class="PType  prettyprint " nowrap>&nbsp;ProgressEvent</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote><p>Handles raw HTTP/HTTPS data from the SOCKS5 tunnel socket.&nbsp; Authentication, tunnel establishment, and message parsing branching (how responses are interpreted), are all handled automatically in this method.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>param</td><td class=CDLDescription>  eventObj A standard ProgressEvent event (usually from an active Socket instance).&nbsp; </td></tr></table></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile><a href="../../Main-as.html">Main</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Org</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="utils/LoaderConfig-as.html">LoaderConfig</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Model</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="model/HTTPCookie-as.html">HTTPCookie</a></div></div><div class=MEntry><div class=MFile><a href="model/HTTPResponse-as.html">HTTPResponse</a></div></div><div class=MEntry><div class=MFile><a href="model/HTTPResponseHeader-as.html">HTTPResponseHeader</a></div></div><div class=MEntry><div class=MFile><a href="model/SOCKS5Model-as.html">SOCKS5Model</a></div></div><div class=MEntry><div class=MFile><a href="model/TorASError-as.html">TorASError</a></div></div><div class=MEntry><div class=MFile><a href="model/TorControlCircuit-as.html">TorControlCircuit</a></div></div><div class=MEntry><div class=MFile><a href="model/TorControlCircuitHop-as.html">TorControlCircuitHop</a></div></div><div class=MEntry><div class=MFile><a href="model/TorControlModel-as.html">TorControlModel</a></div></div></div></div></div><div class=MEntry><div class=MFile id=MSelected>SOCKS5Tunnel</div></div><div class=MEntry><div class=MFile><a href="events/SOCKS5TunnelEvent-as.html">SOCKS5TunnelEvent</a></div></div><div class=MEntry><div class=MFile><a href="TorControl-as.html">TorControl</a></div></div><div class=MEntry><div class=MFile><a href="events/TorControlEvent-as.html">TorControlEvent</a></div></div><div class=MEntry><div class=MFile><a href="utils/URLUtil-as.html">URLUtil</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Demos</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="../../demos/CircuitsDemo-as.html">CircuitsDemo</a></div></div><div class=MEntry><div class=MFile><a href="../../demos/HTTPLoadDemo-as.html">HTTPLoadDemo</a></div></div><div class=MEntry><div class=MFile><a href="../../demos/HTTPSLoadDemo-as.html">HTTPSLoadDemo</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent13')">Com</a><div class=MGroupContent id=MGroupContent13><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent9')">Crypto</a><div class=MGroupContent id=MGroupContent9><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">Cert</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/cert/MozillaRootCertificates-as.html">MozillaRootCertificates</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/cert/X509Certificate-as.html">X509Certificate</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/cert/X509CertificateCollection-as.html">X509CertificateCollection</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/Crypto-as.html">Crypto</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">Hash</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/hash/HMAC-as.html">HMAC</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/hash/IHash-as.html">IHash</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/hash/MD2-as.html">MD2</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/hash/MD5-as.html">MD5</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/hash/SHA1-as.html">SHA1</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/hash/SHA224-as.html">SHA224</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/hash/SHA256-as.html">SHA256</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/hash/SHABase-as.html">SHABase</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent6')">Prng</a><div class=MGroupContent id=MGroupContent6><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/prng/ARC4-as.html">ARC4</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/prng/IPRNG-as.html">IPRNG</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/prng/Random-as.html">Random</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/prng/TLSPRF-as.html">TLSPRF</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/rsa/RSAKey-as.html">RSAKey</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent7')">Symmetric</a><div class=MGroupContent id=MGroupContent7><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/AESKey-as.html">AESKey</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/BlowFishKey-as.html">BlowFishKey</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/CBCMode-as.html">CBCMode</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/CFB8Mode-as.html">CFB8Mode</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/CFBMode-as.html">CFBMode</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/CTRMode-as.html">CTRMode</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/DESKey-as.html">DESKey</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/ECBMode-as.html">ECBMode</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/ICipher-as.html">ICipher</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/IMode-as.html">IMode</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/IPad-as.html">IPad</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/IStreamCipher-as.html">IStreamCipher</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/ISymmetricKey-as.html">ISymmetricKey</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/IVMode-as.html">IVMode</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/NullPad-as.html">NullPad</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/OFBMode-as.html">OFBMode</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/PKCS5-as.html">PKCS5</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/SimpleIVMode-as.html">SimpleIVMode</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/TLSPad-as.html">TLSPad</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/TripleDESKey-as.html">TripleDESKey</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/symmetric/XTeaKey-as.html">XTeaKey</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent8')">Tls</a><div class=MGroupContent id=MGroupContent8><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/BulkCiphers-as.html">BulkCiphers</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/CipherSuites-as.html">CipherSuites</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/KeyExchanges-as.html">KeyExchanges</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/MACs-as.html">MACs</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/TLSConfig-as.html">TLSConfig</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/TLSConnectionState-as.html">TLSConnectionState</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/TLSEngine-as.html">TLSEngine</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/TLSError-as.html">TLSError</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/TLSEvent-as.html">TLSEvent</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/TLSSecurityParameters-as.html">TLSSecurityParameters</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/TLSSocket-as.html">TLSSocket</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/crypto/tls/TLSTest-as.html">TLSTest</a></div></div></div></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent10')">Math</a><div class=MGroupContent id=MGroupContent10><div class=MEntry><div class=MFile><a href="../../com/hurlant/math/BarrettReduction-as.html">BarrettReduction</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/math/BigInteger-as.html">BigInteger</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/math/ClassicReduction-as.html">ClassicReduction</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/math/IReduction-as.html">IReduction</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/math/MontgomeryReduction-as.html">MontgomeryReduction</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/math/NullReduction-as.html">NullReduction</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent12')">Util</a><div class=MGroupContent id=MGroupContent12><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/ArrayUtil-as.html">ArrayUtil</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/Base64-as.html">Base64</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent11')">Der</a><div class=MGroupContent id=MGroupContent11><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/ByteString-as.html">ByteString</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/DER-as.html">DER</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/IAsn1Type-as.html">IAsn1Type</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/Integer-as.html">Integer</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/ObjectIdentifier-as.html">ObjectIdentifier</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/OID-as.html">OID</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/PEM-as.html">PEM</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/PrintableString-as.html">PrintableString</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/Sequence-as.html">Sequence</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/Set-as.html">Set</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/Type-as.html">Type</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/der/UTCTime-as.html">UTCTime</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/Hex-as.html">Hex</a></div></div><div class=MEntry><div class=MFile><a href="../../com/hurlant/util/Memory-as.html">Memory</a></div></div></div></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent14')">Index</a><div class=MGroupContent id=MGroupContent14><div class=MEntry><div class=MIndex><a href="../../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Interfaces.html">Interfaces</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Properties.html">Properties</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Functions">Functions</option><option value="Interfaces">Interfaces</option><option value="Properties">Properties</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([2, 1], 15);// --></script></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CConstant><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public static const defaultSOCKSIP: String</td></tr></table></blockquote>Default SOCKS5 IP address. </div></div><div class=CToolTip id="tt2"><div class=CConstant><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public static const defaultSOCKSPort: int</td></tr></table></blockquote>Default SOCKS5 port.</div></div><div class=CToolTip id="tt3"><div class=CConstant><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public static const maxRedirects: int</td></tr></table></blockquote>Maximum number of redirects to follow, if enabled, whenever a 301 or 302 HTTP status is received.</div></div><div class=CToolTip id="tt4"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _tunnelSocket: Socket</td></tr></table></blockquote></div></div><div class=CToolTip id="tt5"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _secureTunnelSocket: TLSSocket</td></tr></table></blockquote></div></div><div class=CToolTip id="tt6"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _tunnelIP: String</td></tr></table></blockquote></div></div><div class=CToolTip id="tt7"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _tunnelPort: int</td></tr></table></blockquote></div></div><div class=CToolTip id="tt8"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _connectionType: int</td></tr></table></blockquote></div></div><div class=CToolTip id="tt9"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _connected: Boolean</td></tr></table></blockquote></div></div><div class=CToolTip id="tt10"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _authenticated: Boolean</td></tr></table></blockquote></div></div><div class=CToolTip id="tt11"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _tunneled: Boolean</td></tr></table></blockquote></div></div><div class=CToolTip id="tt12"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _requestActive: Boolean</td></tr></table></blockquote></div></div><div class=CToolTip id="tt13"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _requestBuffer: Array</td></tr></table></blockquote></div></div><div class=CToolTip id="tt14"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _responseBuffer: ByteArray</td></tr></table></blockquote></div></div><div class=CToolTip id="tt15"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _HTTPStatusReceived: Boolean</td></tr></table></blockquote></div></div><div class=CToolTip id="tt16"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _HTTPHeadersReceived: Boolean</td></tr></table></blockquote></div></div><div class=CToolTip id="tt17"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _HTTPResponse: HTTPResponse</td></tr></table></blockquote></div></div><div class=CToolTip id="tt18"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _currentRequest: URLRequest</td></tr></table></blockquote></div></div><div class=CToolTip id="tt19"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private var _redirectCount: int</td></tr></table></blockquote></div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function SOCKS5Tunnel(</td><td class="PParameter  prettyprint " nowrap>tunnelIP:</td><td class="PType  prettyprint " nowrap>&nbsp;String</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%>null,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>tunnelPort:</td><td class="PType  prettyprint " nowrap>&nbsp;int</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%>-1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Creates an instance of a SOCKS5 proxy tunnel.</div></div><div class=CToolTip id="tt21"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get tunnelIP():String</td></tr></table></blockquote>The current SOCKS proxy tunnel IP being used by the instance.</div></div><div class=CToolTip id="tt22"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get tunnelPort():int</td></tr></table></blockquote>The current SOCKS proxy tunnel port being used by the instance.</div></div><div class=CToolTip id="tt23"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get connectionType():int</td></tr></table></blockquote>The tunnel connection type being managed by this instance.</div></div><div class=CToolTip id="tt24"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get connected():Boolean</td></tr></table></blockquote>The status of the tunnel connection (true=connected, false=not connected). </div></div><div class=CToolTip id="tt25"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get tunneled():Boolean</td></tr></table></blockquote>The status of the proxy tunnel (true=ready, false=not ready). </div></div><div class=CToolTip id="tt26"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>public function loadHTTP(</td><td class="PParameter  prettyprint " nowrap>request:</td><td class="PType  prettyprint " nowrap>&nbsp;URLRequest</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote>Sends a HTTP request through the socks proxy, sending any included information (such as form data) in the process. </div></div><div class=CToolTip id="tt27"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function get activeRequest():*</td></tr></table></blockquote>The currently active HTTP/HTTPS request being handled by the tunnel instance.</div></div><div class=CToolTip id="tt28"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">public function establishNewCircuit():Boolean</td></tr></table></blockquote>Attempts to establish a new Tor circuit through a running TorControl instance. </div></div><div class=CToolTip id="tt29"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function disconnectSocket():void</td></tr></table></blockquote>Disconnects the SOCKS5 tunnel socket if connected.</div></div><div class=CToolTip id="tt30"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function removeSocketListeners():void</td></tr></table></blockquote>Removes standard listeners to the default SOCKS5 tunnel socket.</div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function addSocketListeners():void</td></tr></table></blockquote>Adds standard listeners to the default SOCKS5 tunnel socket.</div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function onTunnelConnect(</td><td class="PParameter  prettyprint " nowrap>eventObj:</td><td class="PType  prettyprint " nowrap>&nbsp;Event</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote>Invoked when the SOCKS5 tunnel socket connection is successfully established.</div></div><div class=CToolTip id="tt33"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function onTunnelConnectError(</td><td class="PParameter  prettyprint " nowrap>eventObj:</td><td class="PType  prettyprint " nowrap>&nbsp;IOErrorEvent</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote>Invoked when the SOCKS5 tunnel receives an IOErrorEvent event.</div></div><div class=CToolTip id="tt34"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function onTunnelDisconnect(</td><td class="PParameter  prettyprint " nowrap>eventObj:</td><td class="PType  prettyprint " nowrap>&nbsp;Event</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote>Invoked when the SOCKS5 tunnel socket has been disconnected.</div></div><div class=CToolTip id="tt35"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function authenticateTunnel():void</td></tr></table></blockquote>Invoked to authenticate the SOCKS5 tunnel after it is connected. </div></div><div class=CToolTip id="tt36"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function onAuthenticateTunnel():void</td></tr></table></blockquote>Invoked when the SOCKS5 tunnel authentication has completed and the end-to-end connection is ready to be established.</div></div><div class=CToolTip id="tt37"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function establishHTTPTunnel():void</td></tr></table></blockquote>Establishes a HTTP/HTTPS tunnel once the SOCKS5 socket has been connected and authenticated. </div></div><div class=CToolTip id="tt38"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function onEstablishTunnel():void</td></tr></table></blockquote>Invoked when the SOCKS5 tunnel has been established (connected and authenticated).</div></div><div class=CToolTip id="tt39"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function sendQueuedHTTPRequest():void</td></tr></table></blockquote>Sends the next queued HTTP/HTTPS request. </div></div><div class=CToolTip id="tt40"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">private function startTLSTunnel():void</td></tr></table></blockquote>Starts TLS for HTTPS requests/responses.</div></div><div class=CToolTip id="tt41"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function authResponseOkay(</td><td class="PParameter  prettyprint " nowrap>respData:</td><td class="PType  prettyprint " nowrap>&nbsp;ByteArray</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote>Tests whether or not the SOCKS5 authentication request was successful.</div></div><div class=CToolTip id="tt42"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function tunnelResponseOkay(</td><td class="PParameter  prettyprint " nowrap>respData:</td><td class="PType  prettyprint " nowrap>&nbsp;ByteArray</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote>Tests whether or not the SOCKS5 response indicates that the tunnel has been established and is ready for communication.</div></div><div class=CToolTip id="tt43"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function tunnelRequestComplete(</td><td class="PParameter  prettyprint " nowrap>respData:</td><td class="PType  prettyprint " nowrap>&nbsp;ByteArray</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote>Tests whether or not the SOCKS5 response data indicates that the entire HTTP/HTTPS request and response are complete.</div></div><div class=CToolTip id="tt44"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function handleHTTPRedirect(</td><td class="PParameter  prettyprint " nowrap>responseObj:</td><td class="PType  prettyprint " nowrap>&nbsp;HTTPResponse</td><td class="PAfterParameters  prettyprint "nowrap>):Boolean</td></tr></table></td></tr></table></blockquote>Handles a HTTP redirect (301 or 302 response code).</div></div><div class=CToolTip id="tt45"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function handleHTTPResponse(</td><td class="PParameter  prettyprint " nowrap>rawData:</td><td class="PType  prettyprint " nowrap>&nbsp;ByteArray,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>secure:</td><td class="PType  prettyprint " nowrap>&nbsp;Boolean</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%>false</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote>Handles a raw, partial or complete HTTP response. </div></div><div class=CToolTip id="tt46"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>private function onTunnelData(</td><td class="PParameter  prettyprint " nowrap>eventObj:</td><td class="PType  prettyprint " nowrap>&nbsp;ProgressEvent</td><td class="PAfterParameters  prettyprint "nowrap>):void</td></tr></table></td></tr></table></blockquote>Handles raw HTTP/HTTPS data from the SOCKS5 tunnel socket. </div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>